package com.pope945.mypanel;

import java.awt.BorderLayout;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.jdesktop.application.Application;
import org.jdesktop.jdic.browser.WebBrowser;


public class ComBrowserUrlPanel extends JPanel {
	public ComBrowserUrlPanel(String url) {
		
		initGUI(url);
		
		
		
	}
	
	private void initGUI(String url) {
		try {
			{
				this.setPreferredSize(new java.awt.Dimension(490, 324));
				
				WebBrowser webBrowser;
				
				try {
		        	webBrowser = new WebBrowser(new URL(url));

		        } catch (MalformedURLException e) {
		            System.out.println(e.getMessage());
		            return;
		        }
		        this.setLayout(new BorderLayout());
		        this.add(webBrowser,BorderLayout.CENTER);
		       

				
			}
			Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(this);
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

}

